import { createSlice } from "@reduxjs/toolkit";

const homeSlice = createSlice({
  name: "home",
  initialState: {
    selectedTab: "",
    searchValue: "",
  },
  reducers: {
    setSlectedTab: (
      state: { selectedTab: string },
      { payload }: { payload: string }
    ) => {
      state.selectedTab = payload;
    },
    setSearchValue: (
      state: { searchValue: string },
      { payload }: { payload: string }
    ) => {
      state.searchValue = payload;
    },
  },
});

export const { setSlectedTab, setSearchValue } = homeSlice.actions;
export default homeSlice.reducer;
